package rudy.elevator.thread;

import rudy.elevator.ui.MainPanel;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import rudy.elevator.bean.LiftBean;

public class ControlDoor extends Thread{
    private MainPanel panel;
    public ControlDoor(MainPanel  panel) {
        this.panel = panel;
    }

    public void run()
    {
        LiftBean   [] lifts = panel.getLiftbean();
        LiftBean  lift = lifts[0];
        for (int i = 0; i < lift.getDx() / 2; i++) {
            lift.setXx(i);
            try {
                Thread.sleep(5);
            } catch (InterruptedException ex) {
            }
            panel.repaint();
        }

    }
}
